﻿@{
    Layout = "";
}

<!DOCTYPE html>

<html>
<head>
    <title>保养单记录信息Maintenance sheet record information</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <!-- VENDOR CSS -->
    <link rel="stylesheet" type="text/css" href="~/Content/vendor/jquery/jquery-ui.css">
    <link rel="stylesheet" type="text/css" href="~/Content/vendor/bootstrap/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="~/Content/vendor/bootstrap/bootstrap-datetimepicker.css">
    <link rel="stylesheet" type="text/css" href="~/Content/vendor/font-awesome/font-awesome.css">
    <link rel="stylesheet" type="text/css" href="~/Content/vendor/toastr/toastr.css">
    <link rel="stylesheet" type="text/css" href="~/Content/vendor/klorofil/main.css">
    <link rel="stylesheet" type="text/css" href="~/Content/aztech-style.css">

    <script type="text/javascript" src="~/Scripts/vendor/modernizr-2.6.2.js"></script>
</head>
<body>
    <div class="panel">
        <div class="panel-body">
            <form id="recordForm" class="form-horizontal">
                <div id="equipmentCode" class="form-group">
                    <label for="equipmentCode" class="col-sm-2 control-label">设备编号Equipment number</label>
                    <div class="col-sm-9">
                        <div class="input-group input-group-sm">
                            <input type="text" class="form-control" placeholder="请填保养设备的公司编号Please fill in the company number of the maintenance equipment" v-model="record.Equipment.BaseInfo.Code" v-on:blur="GetEquipment" />
                            <span class="btn input-group-addon" v-on:click="ScanQrcode">
                                <i class="fa fa-qrcode">
                                    <input type="file" class="form-control" accept="image/*" style="display: none;" />   
                                </i>
                            </span>
                        </div>
                    </div>
                </div>
                <div id="equipmentInfo" class="form-group">
                    <div class="col-sm-9 col-sm-offset-2">
                        <table class="table table-bordered">
                            <tbody>
                                <tr class="warning">
                                    <td>设备名称Equipment name</td>
                                    <td>{{record.Equipment.BaseInfo.Name}}</td>
                                </tr>
                                <tr class="warning">
                                    <td>设备型号Equipment model</td>
                                    <td>{{record.Equipment.BaseInfo.Model}}</td>
                                </tr>
                                <tr class="warning">
                                    <td>使用楼层use storey</td>
                                    <td>{{record.Equipment.BaseInfo.Floor}}</td>
                                </tr>
                                <tr class="warning">
                                    <td>设备状态Equipment status</td>
                                    <td>
                                        <span v-for="(value, key, idx) in statusDictionary">
                                            <span v-if="value == record.Equipment.BaseInfo.Status">{{key}}</span>
                                        </span>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <div id="recordDate" class="form-group">
                    <label for="recordDate" class="col-sm-2 control-label">保养日期Maintenance date</label>
                    <div class="col-sm-9">
                        <div class="input-group input-group-sm">
                            <input id="recordDatePicker" type="text" class="form-control" v-model="record.BaseInfo.RecordDate" />
                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        </div>
                    </div>
                </div>
                <div id="checkerName" class="form-group">
                    <label for="checkerName" class="col-sm-2 control-label">保养人Maintainer</label>
                    <div class="col-sm-9">
                        <input type="text" class="form-control" placeholder="请填保养人姓名Please fill in the name of the maintainer" v-model="record.CheckerInfo.Name" v-on:blur="GetCheckerInfo" />
                    </div>
                </div>
                <div id="checkerInfo" class="form-group">
                    <div class="col-sm-9 col-sm-offset-2">
                        <table class="table table-bordered">
                            <tbody>
                                <tr class="warning">
                                    <td>邮箱mailbox</td>
                                    <td>{{record.CheckerInfo.Email}}</td>
                                </tr>
                                <tr class="warning">
                                    <td>电话Telephone</td>
                                    <td>{{record.CheckerInfo.Mobile}}</td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <div id="approverName" class="form-group">
                    <label for="approverName" class="col-sm-2 control-label">管理员（签核）Administrator (sign off)</label>
                    <div class="col-sm-9">
                        <input type="text" class="form-control" placeholder="请填签核人姓名Please fill in the name of the approver" v-model="record.ApproverInfo.Name" disabled />
                    </div>
                </div>
                <div id="approverInfo" class="form-group">
                    <div class="col-sm-9 col-sm-offset-2">
                        <table class="table table-bordered">
                            <tbody>
                                <tr class="warning">
                                    <td>邮箱mailbox</td>
                                    <td>{{record.ApproverInfo.Email}}</td>
                                </tr>
                                <tr class="warning">
                                    <td>电话Telephone</td>
                                    <td>{{record.ApproverInfo.Mobile}}</td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <div id="templateFormID" class="form-group">
                    <label for="templateFormID" class="col-sm-2 control-label">保养单模板Maintenance order template</label>
                    <div class="col-sm-9">
                        <select class="form-control" v-model="record.TemplateForm.BaseInfo.ID" v-on:change="GetTemplateForm">
                            <option v-for="(form, index) in templateFormList" v-bind:value="form.ID">{{form.Name}}</option>
                        </select>
                    </div>
                </div>
                
                <div id="maintItems" class="form-group">
                    <label for="maintItems" class="col-sm-2 control-label">保养项目maintenance program</label>
                    <div class="col-sm-9">
                        <ul class="list-group">
                            <li v-if="record.TemplateForm.Items.length > 0" class="list-group-item text-right">
                                <button class="btn btn-info" v-on:click="BatchItemCheck">一键通过One click through</button>
                            </li>
                            <li v-bind:id="'itemRecord' + index" class="list-group-item" v-for="(item, index) in record.TemplateForm.Items">
                                <div class="row">
                                    <div class="col-sm-7">
                                        <h5>{{item.Name}}</h5>
                                    </div>
                                    <div class="col-sm-5 text-right">
                                        <button class="btn btn-danger btn-xs" v-on:click="ItemCheck($event, index, 0)">不通过Fail</button>
                                        <button class="btn btn-success btn-xs item-pass-btn" v-on:click="ItemCheck($event, index, 1)">通过adopt</button>
                                    </div>
                                    <div class="col-sm-12" style="padding-top: 2px;">
                                        <input v-bind:id="'itemRemark' + index" class="form-control input-sm" type="text" placeholder="请填写处理方法及结果Please fill in the treatment method and results

。" v-on:blur="ItemRemark($event, index)" />
                                    </div>
                                </div>
                            </li>
                        </ul>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                        <input type="text" v-model="record.BaseInfo.ID" hidden />
                        <button v-if="isNewRecord" class="btn btn-primary" v-on:click="SaveRecord($event)">保存preservation</button>
                        <button v-if="!isNewRecord" class="btn btn-default" v-on:click="UpdateRecord($event)">更新renew</button>
                        <button class="btn btn-warning" v-on:click="Signout($event)">登出logout</button>
                    </div>
                </div>
            </form>
        </div>

    </div>


    <script type="text/javascript" src="~/Scripts/vendor/jquery/jquery-1.10.2.min.js"></script>
    <script type="text/javascript" src="~/Scripts/vendor/jquery/jquery.cookie.min.js"></script>
    <script type="text/javascript" src="~/Scripts/vendor/jquery/jquery.slimscroll.min.js"></script>
    <script type="text/javascript" src="~/Scripts/vendor/bootstrap/bootstrap.min.js"></script>
    <script type="text/javascript" src="~/Scripts/vendor/bootstrap/bootstrap-datetimepicker.min.js"></script>
    <script type="text/javascript" src="~/Scripts/vendor/toastr/toastr.min.js"></script>
    <script type="text/javascript" src="~/Scripts/vendor/klorofil/klorofil-common.js"></script>
    <script type="text/javascript" src="~/Scripts/vendor/respond.min.js"></script>
    <script type="text/javascript" src="~/Scripts/vendor/vue/vue.min.js"></script>
    <script type="text/javascript" src="~/Scripts/aztech-global.js?v=@DateTime.Now.ToFileTimeUtc()"></script>
    <script type="text/javascript" src="~/Scripts/aztech-script.js?v=@DateTime.Now.ToFileTimeUtc()"></script>
    <script type="text/javascript" src="~/Scripts/pageJs/Maintain/RecordDetail.js?v=@DateTime.Now.ToFileTimeUtc()"></script>
</body>
</html>
